package net.xiduth.game.npc.combat.impl;

import net.xiduth.game.Animation;
import net.xiduth.game.Entity;
import net.xiduth.game.Graphics;
import net.xiduth.game.World;
import net.xiduth.game.npc.NPC;
import net.xiduth.game.npc.combat.CombatScript;
import net.xiduth.game.npc.combat.NPCCombatDefinitions;

/**
 * 
 * @author Jae <jae@xiduth.com>
 * 
 * Last modified: <Oct 17, 2013>
 *
 */
public class Karamel extends CombatScript {

	@Override
	public Object[] getKeys() {
		return new Object[] { 3495};
	}

	@Override
	public int attack(NPC npc, Entity target) {
		final NPCCombatDefinitions defs = npc.getCombatDefinitions();
		npc.setNextAnimation(new Animation(defs.getAttackEmote()));
		int damage = getRandomMaxHit(npc, defs.getMaxHit(), NPCCombatDefinitions.MAGE, target);
		if(damage != 0) {	
			target.setNextGraphics(new Graphics(369, 0, 100));
		}
		World.sendProjectile(npc, target, 368, 60, 32, 50, 50, 0, 0);
		delayHit(npc, 2, target, getMagicHit(npc, damage));
		return defs.getAttackDelay();
	}

}
